Integrated control system and method for controlling mode, synchronization, power factor, and utility outage ride-through for micropower generation systems

ABSTRACT

An integrated system for comprehensive control of an electric power generation system utilizes state machine control having particularly defined control states and permitted control state transitions. In this way, accurate, dependable and safe control of the electric power generation system is provided. Several of these control states may be utilized in conjunction with a utility outage ride-through technique that compensates for a utility outage by predictably controlling the system to bring the system off-line and to bring the system back on-line when the utility returns. Furthermore, a line synchronization technique synchronizes the generated power with the power on the grid when coming back on-line. The line synchronization technique limits the rate of synchronization to permit undesired transient voltages. The line synchronization technique operates in either a stand-alone mode wherein the line frequency is synthesized or in a connected mode which sensed the grid frequency and synchronizes the generated power to this senses grid frequency. The system also includes power factor control via the line synchronization technique or via an alternative power factor control technique. The result is an integrated system providing a high degree of control for an electric power generation system.

BACKGROUND OF THE INVENTION

[0001] 1. Technical Field of the Invention

[0002] This invention relates to control systems and methods forcontrolling inverter based electrical power generation and feeding ofgenerated power to a grid. This invention particularly relates to anintegrated control system and method that integrates a variety of powercontrol functions including state machine control of distinctoperational modes, synronization with the grid, power factor control andutility outage ride-through.

[0003] 2. Description of Related Art

[0004] Various control devices for controlling inverter based electricalpower generation are known in the art. Typical controllers utilizeanalog voltage or current reference signals, synchronized with the gridto control the generated wave form being fed to the grid. Suchcontrollers, however, lack distinct control states and the capability ofcontrolling transitions between specifically defined control states.

[0005] Various techniques for synchronizing the frequency of generatedpower to the frequency of a grid-are also known in the art. Suchconventional line synchronizers typically sense the line frequency ofthe grid and lock to the grid when the generated frequency drifts intosynchronization.

[0006] Such conventional line synchronizers, however, do not have theability to control the rate of phase shift of the generated power or theability to interface easily with both 50 Hz and 60 Hz grids.

[0007] Various techniques for controlling the power factor are alsoknown in the art. In the context of electrical power generation, forexample, Erdman, U.S. Pat. No. 5,225,712, issued Jul. 6, 1993, disclosesa variable wind speed turbine electrical power generator having powerfactor control. The inverter can control reactive power output as apower factor angle or directly as a number of VARs independent of thereal power. To control the reactive power, Erdman utilizes a voltagewaveform as a reference to form a current control waveform for eachoutput phase. The current control waveform for each phase is applied toa current regulator which regulates the drive current that controls thecurrents for each phase of the inverter.

[0008] Although the conventional art may individually provide some ofthese features, the combination of these features particularly whenutilized in conjunction with an integrated system utilizing statemachine control is not found in the art.

[0009] Other applications distinct from electrical power generation alsoutilize power factor control devices. For example, Hall, U.S. Pat. No.5,773,955 issued Jun. 30, 1998, discloses a battery charger apparatusthat controls the power factor by vector control techniques. The controlloop utilized by Hall controls power delivery to the battery to obtain adesired charge profile by individually controlling the real and reactivecomponents of the AC input current. The AC input current is forced tofollow a reference that is generated in response to information receivedby the battery charge control circuit to supply the desired chargingcurrent to and remove discharge current from a battery.

SUMMARY AND OBJECTS OF THE INVENTION

[0010] An object of the invention is to provide an integrated system forcontrolling all aspects of inverter based electrical power generationand feeding of generated power to a grid. Another object of theinvention is to provide a state machine having a plurality of definedcontrol states for electric power transformation including a statecontroller that controls permitted transitions between the definedcontrol states.

[0011] Another object of the invention is to provide a linesynchronization technique that is highly flexible and permitssynchronization with either a 50 Hz or 60 Hz grid as well as providingsmooth transitioning from a stand-alone mode to a grid-connected mode.

[0012] A further object of the invention is to provide a linesynchronization technique that can either sense the grid frequency orsynthesize a frequency for electrical power generation.

[0013] Still another object of the invention is to control there-synchronization rate to provide the smooth transition fromstand-alone mode to a grid-connected mode.

[0014] A further object of the invention is to provide a method ofcontrolling an electrical power generator during a utility outage.

[0015] Yet another object of the invention is to integrate the inventivemethod of utility outage ride-through with various other controltechniques to provide an integrated system.

[0016] Still another object of the invention is to provide power factorcontrol over generated electrical power wherein a simple DC controlsignal having two components commanding the real and reactive componentsof the generated power may be utilized to control the power factor.

[0017] The objects of the invention are achieved by providing a statemachine having a plurality of control states for electric powertransformation including an initialization state, a first neutral state,a pre-charge state, a second neutral state, an engine start state, apower on-line state, a power off-line state, and a shut down statewherein the state controller controls state transitions such that onlypermitted transitions between control states are allowed to occur. Inthis way, a high degree of control can be achieved for electrical powergenerating and feeding of electrical power to a grid. In this way, thesafety and reliability of the system can be ensured.

[0018] The objects of the invention are further achieved by a method ofcontrolling real and reactive power developed by a main inverter in anelectrical power generation control device including the steps ofsampling the three-phase currents output from the inverter, transformingthe sampled three-phase current data to two-phase current data,transforming the two-phase current data to a rotating reference frame,controlling an output voltage according to a comparison result between aDC reference signal having real and reactive reference signalcomponents, transforming the output voltage to a stationary referenceframe, transforming the stationary reference frame output voltage to athree-phase reference signal, and controlling the inverter based on thethree-phase reference signal. By utilizing such a control method, the DCreference signal can be input by an operator or a utility feeding thegrid to thereby designate the real and reactive power output by thecontrolled inverter.

[0019] The objects of the invention are further achieved by providing aline frequency synchronization apparatus and method that utilizes afrequency sensor that samples the frequency of the grid or a synthesizerthat synthesizes a grid frequency. In the case of sampled gridfrequency, the frequency sensor signal is converted by an A/D converterthat is controlled by initiating the conversion and reading of thedigital value at a fixed frequency. This fixed frequency establishes thetime base for which the invention can compute the actual frequency ofthe signal. This is further accomplished by determining when the fallingor rising edge of the signal occurs and counting the number of samplestherebetween.

[0020] In this way, a synchronization error signal is generated that canbe utilized to bring the generated power into synchronization with agrid or the synthesized grid frequency. Furthermore, the synchronizationshift rate is preferably limited in order to provide a smoothtransition.

[0021] The objects of the invention are further achieved by providing autility outage ride-through method and apparatus that detects a faultcondition indicating that the electrical power generation device shouldbe disconnected from the grid, opens a contactor that connects thedevice to the grid, clears a time counter, sets a mode to an off-linemode, commands the inverter within the device to perform off-linevoltage control, and waits for a predetermined time period after allfault conditions have been cleared before setting the mode to an on-linecurrent control mode, enabling the inverter and thereafter closing thecontactor to reestablish the connection to the grid.

[0022] Further scope of applicability of the present invention willbecome apparent from the detailed description given hereinafter.However, it should be understood that the detailed description andspecific examples, while indicating preferred embodiments of theinvention, are given by way of illustration only, since various changesand modifications within the spirit and scope of the invention willbecome apparent to those skilled in the art from this detaileddescription.

BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The present invention will become more fully understood from thedetailed description given hereinbelow and the accompanying drawingswhich are given by way of illustration only, and thus are not limitativeof the present invention, and wherein:

[0024]FIG. 1 is a high-level block diagram illustrating the majorcomponents of a microturbine generator system that may be controlledaccording to the invention;

[0025]FIG. 2 is a high-level block diagram of a small grid-connectedgeneration facility which is another example of a generation facilitythat may be controlled according to the invention;

[0026]FIG. 3 is a system block diagram of an electrical power generatoraccording to the invention illustrating major components, data signalsand control signals;

[0027]FIG. 4 is a detailed circuit diagram of a line power unit that maybe controlled according to the invention;

[0028]FIG. 5(a) is a state diagram according to a first embodiment ofthe invention that illustrates the control states and permitted controlstate transitions according to the invention;

[0029]FIG. 5(b) is another state diagram illustrating a secondembodiment according to the invention showing the control states andpermitted control state transitions according to the invention;

[0030]FIG. 6(a) is a block diagram illustrating a line synchronizationapparatus according to the invention;

[0031]FIG. 6(b)-(d) illustrate synchronization and phase-shift angles ina coordinated diagram showing relative positions and transitions of thesignals according to the invention;

[0032] FIGS. 7(a)-(b) are flow charts illustrating the linesynchronization method according to the invention;

[0033]FIG. 8 is a flow chart illustrating the utility outageride-through method according to the invention; and

[0034]FIG. 9 is a control-loop block diagram illustrating the powerfactor control method according to the invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0035]FIG. 1 illustrates the major components of a line-power unit 100containing the inventive control devices and methods and the overallrelationship to a microturbine generator. As shown, the microturbinegenerator system includes two major components: the turbine unit 10 andthe line-power unit 100 may be arranged as shown in FIG. 1.

[0036] The turbine unit 10 includes a motor/generator 15 and an enginecontrol unit 12. The turbine unit 10 is supplied with fuel. For example,the motor/generator 15 may be constructed with an Allied Signal TurboGenerator™ which includes a turbine wheel, compressor, impeller andpermanent magnet generator which are all mounted on a common shaft. Thiscommon shaft is supported by an air bearing which has a relatively highinitial drag until a cushion of air is developed at which point the airbearing is nearly frictionless.

[0037] The motor (engine) in the motor/generator 15 is controlled by theengine control unit 12 which, for example, throttles the engineaccording to the demand placed upon the generator. Communication isprovided between the turbine unit 10 and the line power unit 100 asshown by the control/data line connecting these units in FIG. 1. Thisdata includes operating data such as turbine speed, temperature etc. aswell as faults, status and turbine output.

[0038] The motor/generator 15 supplies three-phase (3) electrical powerto the line power unit 100 as further shown in FIG. 1. The line powerunit 100 also supplies three-phase auxiliary power (3 Aux) to theturbine unit 10.

[0039] The line power unit 100 contains three basic components. The linepower unit controller 200, starter 220 and utility interface 240 are allincluded within line power unit 100. Furthermore, an operator interfacethat permits an operator to monitor and control the line power unit isfurther provided. The operator interface may include a front paneldisplay for displaying critical operating data as well as controls suchas a shut down switch and power level command input as further describedbelow.

[0040] A DC bus supplies DC power to the line power unit 100 to permitoff-grid starting of the turbine unit. Furthermore, the utilityinterface 240 supplies three-phase electrical power to the utility grid99 as well as an optional neutral line. The line power unit 100 alsoreceives utility authorization from a utility company which authorizesconnection to the grid 99.

[0041]FIG. 2 illustrates a small grid-connected generation facilityshowing some of the details of the components controlled by thisinvention. More particularly, a turbine generator 15 generates AC powerthat is supplied to rectifier 60. The AC power is then converted into DCpower by rectifier 60 and supplied to DC link consisting of DC bus 61and capacitor 62 connected across DC bus 61.

[0042] An inverter 70 transforms the DC voltage on the DC link into athree-phase AC waveform that is filtered by inductor 72 and thensupplied to the utility 99 via contactor K1.

[0043] As further discussed below in relation to FIG. 3, the inventioncontrols the inverter 70 and contactor K1 as well as other components.FIG. 2 is actually a simplified diagram illustrating the necessarycomponents for utility outage ride-through. Other components illustratedin FIGS. 3 and 4 are necessary for other types of control exercised bythe invention such as power factor and synchronization.

[0044]FIG. 3 is a system block diagram illustrating a generationfacility that may be controlled according to the invention. Thegeneration facility includes a turbine generator 15 generating AC powersupplied to rectifier 60. This AC power is converted by rectifier 60into DC voltage supplied to the DC link. This DC link may have the sameconstruction as shown in FIG. 2. The inverter 70 transforms DC powerfrom the DC link into three-phase AC power that is fed to the grid 99via inductor unit 72 and contactor K1. Power may also be supplieddirectly to the internal loads via a connection to the output of theinverter 70.

[0045] The controller 200 receives a sensed voltage from the DC link aswell as the output AC current from the inverter 70 as inputs thereto.The controller 200 utilizes these inputs to generate control signals forthe inverter 70. More particularly, the inverter 70 is controlled bypulse width modulated (PWM) control signals generated by controller 200to output the desired AC waveform. When the generation facility isonline, the controller 200 performs feedback current control byutilizing feedback current supplied by a current sensor located at anoutput side the inverter 70. When the generation facility is offline,however, the control exercised by the controller 200 changes.Specifically, the controller 200 performs feedforward voltage control byutilizing feedforward voltage supplied by a voltage sensor located at aninput side of the inverter 70. These current and voltage sensors forfeedback current control and feedforward voltage control, respectivelymay be part of the inverter 70 or separate therefrom as shown in FIG. 3.

[0046] The controller 200 also outputs a disconnect control signal tocontactor K1 to control the connection of the generation facility to theutility grid 99. Further details of the control method implemented bycontroller 200 are described below.

[0047]FIG. 4 illustrates the details of a line power unit 100 accordingto the invention. This line power unit (LPU) 100 includes an LPUcontroller 200 that may be programmed according to the techniquesdisclosed herein. FIG. 4 is a particularly advantageous embodiment of aline power unit 100 that may be controlled according to the invention.

[0048]FIG. 4 shows the details of the inventive line power unit 100 andits connections to the permanent magnet generator 15, engine controlunit 12 and utility grid 99. The starter unit 220 is generally comprisedof start inverter 80, precharge circuit 78, transformer 76, andtransformer 82. The utility interface generally includes the maininverter 70, low pass filter 72, transformer 74, voltage sensor 98, andcontactor K1. The LPU controller 200 generally includes phase andsequence detector circuit 97, transformer 82, full wave rectifier 83 b,full wave rectifier 83 a, control power supply 84 and LPU controller200. Correspondence between the general construction shown in FIG. 1 andthe detailed embodiment shown in FIG. 4 is not important. Thisdescription is merely for the purpose of orienting one of ordinary skillto the inventive system.

[0049] Turning to the details of the line power unit 100 construction,the permanent magnet generator 15 has all three phases connected to PMGrectifier 60. A DC bus 61 interconnects PMG rectifier 60 and maininverter 70. A capacitor 62 is connected across the DC bus 61.

[0050] The output of the main inverter 70 is connected to transformer 74via low pass LC filter 72. A voltage sense circuit 98 is connected tothe output of the transformer 74 and supplies sensed voltages to the LPUcontroller 200 utilizing the data line shown. The voltage sense circuit98 does not interrupt the power lines as may be incorrectly implied inthe drawings. Instead, the voltage sense circuit is connected across thelines between transformer 74 and contactor K1.

[0051] A contactor K1 is controlled by LPU controller 200 via a controlline as shown in FIG. 4 and provides a switchable connection betweentransformer 75 and the utility grid 99. A neutral line may be tappedfrom transformer 74 as further shown in FIG. 2 and connected to the grid99.

[0052] A separate start inverter 80 is connected to the DC bus 61 andthe external DC voltage supply which may be constructed with a battery.The start inverter 80 is also connected to the permanent magnetgenerator 15.

[0053] A precharge circuit 78 is connected to the grid via transformer76 and transformer 82. Precharge circuit 78 is further connected to theDC bus 61. The precharge circuit 78 has a control input connected to acontrol data line that terminates at the LPU controller 200 as shown.

[0054] The line power unit 100 also supplies power to a local grid(e.g., 240 VAC three phase supplying auxiliary of local loads) viatransformer 74. This local grid feeds local loads and the turbine unitincluding pumps and fans in the turbine unit.

[0055] An auxiliary transformer 77 is also connected to the output ofthe transformer 74. The output of the auxiliary transformer 77 is fed tofull wave rectifier 83 to supply full wave rectified power to thecontrol power supply 84. The control power supply 84 supplies power tothe engine control unit 12 and the LPU controller 200 as well as the I/Ocontroller 310.

[0056] The I/O controller 310 is connected via data lines to the LPUcontroller 200. The I/O controller 310 is further connected to theengine control unit 12, display unit 250, and LPU external interface320. The LPU external interface 320 has a connection for communicationand control via port 321.

[0057] The LPU controller 200 has control lines connected to the startinverter 80, main inverter 70, precharge circuit 78, transformer 82, andcontactor K1. Furthermore, data is also provided to the LPU controller200 from control/data lines from these same elements as well as thephase and sequence detector 97 that is connected at the output ofcontactor K1. The LPU controller 200 also communicates data and controlsignals to the engine control unit 12.

[0058] The engine control unit is supplied power from the control powersupply 84 and communicates with engine sensors as shown.

[0059] State Machine Mode Control

[0060]FIG. 5(a) is a state diagram showing the control states andpermitted control state transitions. The state diagram shown in FIG.5(a) describes a state machine that may be implemented with the LPUcontroller 200 to control the line power unit 100 with the definedstates and control state transitions. This state machine provides modecontrol for the following modes of operation: initialization, neutral,pre-charge, turbine start, power on-line, power off-line, and shut down.

[0061] The state diagram shown in FIG. 5(a) assumes that the line powerunit 100 is mounted in an equipment cabinet having cooling fans andpumps circulating cooling fluid through cold plates. A cold plate ismerely a device that includes a plenum through which cooling fluid iscirculated and to which various power conversion devices such as themain inverter 70 and start inverter 80 are mounted. The cold plate actsas a heat sink for these devices and thereby prevents overheating. Thealternative shown in FIG. 5(b) assumes that no such cabinet or coolingsystem is present and represents a simplified control state diagram forthe invention.

[0062] Before describing the state transitions, a description of eachcontrol state will first be provided.

[0063] The power on/reset condition 500 is not really a control statebut, rather, an initial condition that triggers the state machine. Thisinitial condition includes power on of the line power unit 100 or resetof the line power unit 100.

[0064] The initialization state 505 occurs after reset or power on andinitializes global variables, initializes the serial communication portsincluding the I/O controller 310 and LPU external interface 320 havingserial ports contained therein, executes a built-in-test (BIT), andinitializes the real-time interrupt facility and input capture interruptwithin the LPU controller 200.

[0065] The initialization state also starts the line synchronizationtechniques of the invention which are further described below as well asstarting the power factor control method of the invention.

[0066] The neutral state 510 monitors commands from the I/O controller310 and engine control unit 12 to determine the next mode of operationas well as checking critical system parameters.

[0067] The pre-charge state 515 enables the pre-charge unit 78 to chargethe DC link as well as checking on the rate of charging to determinecorrect hardware function. The pre-charge state 515 also performsdiagnostic checks of the main inverter 70 to identify open or short typefailures.

[0068] The neutral with pre-charge complete state 520 closes contactorK1 and performs diagnostic tests of the line power unit 100.

[0069] The purge cabinet state 525 purges the equipment cabinet in whichthe line power unit 100 is mounted including turning on any cooling fansand pumps and thereby bring the line power unit 100 into a purged andready state.

[0070] The neutral with purge complete state 530 is an idle state thatwaits for an engine start command from the operator that is routed viaport 321 to LPU external interface 320 to I/O controller 310 and therebyto LPU controller 200.

[0071] The start engine state 535 generally performs the function ofstarting the engine that drives the permanent magnet generator 15.

[0072] The start engine state 535 resets the start inverter 80 andperforms basic diagnostic checks of the line power unit 100. The startengine state 535 also verifies the DC link voltage and thereafter setsthe pulse width modulated control signal supplied to the start inverter80 to control the maximum speed that the start inverter 80 will drivethe permanent magnet generator 15 as a motor to thereby permit theengine to start.

[0073] More particularly, the start engine state enables the startinverter 80, receives updated speed commands from the engine controlunit 12, monitors fault signals from the start inverter 80, and checksthe speed of the engine and DC current drawn from the start inverter 80to determine a successful start.

[0074] Actual starting of the engine is under the control of the enginecontrol unit 12 which feeds fuel and any necessary ignition signals tothe engine that is being spun by the permanent magnet generator 15. Thestart engine state 535 then waits for a signal from the engine controlunit 12 to terminate the start operation which involves sending a stopsignal to the start inverter 80.

[0075] Further details of engine starting can be found in relatedapplication Attorney Docket #1215-380P which is hereby incorporated byreference.

[0076] The neutral with start complete state 540 is an idle statewherein the engine is started and the permanent magnet generator 15 isbeing driven by the engine thereby producing three-phase power that isrectified by PMG rectifier 60 to supply DC bus 61 with DC power. Theneutral with start complete state essentially waits for a power levelcommand from the operator that is routed via port 321, LPU externalinterface 320, I/O controller 310 to the LPU controller 200.

[0077] The power on-line state 545 enables the main inverter 70 in acurrent mode and sends pulse width modulated control signals to the maininverter 70 to output three-phase electrical power having the commandedpower level. The power on-line state also performs various system checksto maintain safe operation such as verifying the DC link voltage andcold plate temperatures.

[0078] The open contactor state 550 opens the main contactor K1.

[0079] The power off-line state 555 switches the main inverter 70 to avoltage mode and sets the power level command to a nominal level topower the local loads. The power off-line state may perform varioussystem checks to maintain safe operation.

[0080] The shut down state 560 disables the main inverter 70 andreinitializes global variables that are utilized by the state machine tocontrol the line power unit 100.

[0081] The purge cabinet state 565 performs essentially the samefunctions as the purge cabinet state 525 and ensures that the equipmentcabinet housing the line power unit 100 cools down.

[0082] The open contactor state 570 waits for a nominal cool down periodsuch as 5 minutes as well as controlling the contactor K1 such that itbreaks the connection with the grid 99 thereby ensuring disconnectionfrom the grid 99.

[0083] The clear faults state 575 clears any fault codes that may havetriggered the shutdown.

[0084] The emergency stop indication 580 is not actually a controlstate, but instead illustrates the receipt of an emergency stop signal.The equipment cabinet housing the line power unit 100 preferablyincludes an emergency stop button that a user may trigger to shut downthe system in an emergency.

[0085] The open contactor state 585 is triggered by the receipt of anemergency stop signal and opens main contactor K1 thereby breaking theconnection to the grid 99.

[0086] The state transitions are represented in the drawings witharrows. These arrows convey important information. For example anunidirectional arrow such as → indicates a one-direction onlypermissible state transition. A bi-directional arrow, on the other hand,such as ←→ indicates bi-directional permissible state transitions. Thismay also be expressed by using the following bi-directional andunidirectional permissible state transition symbologies: (1) neutralstate ←→ pre-charge state and (2) power on-line state → power off-linestate.

[0087] The operation of the state machine illustrated in 5(a) will nowbe described.

[0088] After receiving the power on or reset signal 500, theinitialization state 505 is triggered. After completion of theinitialization procedures and successful built-in tests, the statemachine permits the transition to neutral state 510.

[0089] The neutral state 510 monitors commands from the operator andengine control unit 12. Upon receiving an appropriate command, the statemachine permits the transition to the pre-charge state 515 from theneutral state 510.

[0090] As described above, the pre-charge state 515 triggers thepre-charge unit 78 to pre-charge the DC bus 61 to a desired pre-chargevoltage. The pre-charge state 515 determines successful pre-charge bymonitoring the pre-charge rate and determining whether the pre-chargevoltage is within acceptable limits at the end of the pre-charge cycle.

[0091] If the pre-charge state 515 determines that the pre-charge cycleis not successful, then the state machine transitions back to theneutral state 510 as indicated by the fail path illustrated on FIG.5(a). Upon successful completion of the pre-charge cycle, however, thestate machine permits the transition from the pre-charge state 515 tothe neutral with precharge complete state 520.

[0092] The neutral with pre-charge complete state 520 closes the maincontactor K1 thereby connecting the line power unit 100 to the grid 99.Thereafter, the state machine permits the transition to the purgecabinet state 525.

[0093] Upon successful purging of the cabinet and passing of anydiagnostic tests such as checking the cold plate temperatures, the statemachine permits the transition from the purge cabinet state 525 to theneutral with purge complete state 530. Upon receipt of a start enginecommand, the state machine permits the transition to the start enginestate 535.

[0094] As described above, the start engine state 535 control the startinverter 80 to drive the permanent magnet generator 15 as a motor tospin the engine at a speed to permit the engine to be started. If theengine fails to start, then the state machine transitions to the neutralwith purge complete state 530. If the engine successfully starts, thenthe state machine transitions to the neutral with start complete state540 which waits for the receipt of a power level command from theoperator or a remote host.

[0095] Upon receipt of a non-zero power level command, the state machinetransitions from the neutral with start complete state 540 to the poweron-line state 545.

[0096] If there is a utility outage, then the state machine transitionsto the open contactor state 550 as further described in the utilityoutage ride-through section below.

[0097] On the other hand, receipt of a zero power level commandtransitions the state machine from the power on-line state to theneutral with start complete state 540.

[0098] After the open contactor state 550 completes the operation ofopening contactor K1, the power off-line state 555 is entered. Uponcompletion of the power off-line procedures in power off-line state 555,the state machine transitions to the neutral with start complete state540. If a shutdown command is received, the state machine thentransitions to the shutdown state 560. The shutdown state 560 isfollowed by the purge cabinet state 565, open contactor state 570 andclear faults state 575 and then the neutral state 510 thereby bringingthe line power unit 100 into a neutral state.

[0099] Upon receipt of an emergency stop signal 580, the open contactorstate 585 is triggered. Thereafter, the shutdown state 560 is entered bythe state machine and then the purge cabinet state 565, open contactorstate 570, clear faults state 575 and neutral state 510 are sequentiallyentered by the state machine.

[0100]FIG. 5(b) is a simplified state diagram that simplifies the statesand state transitions . illustrated in FIG. 5(a). FIG. 5(b) generallyassumes that there is no cabinet that needs to be purged. The statemachine in FIG. 5(b) also consolidates some of the states illustrated inFIG. 5(a). States having the same reference numerals are identical tothose shown in FIG. 5(a). The differences are pointed out below.

[0101] The neutral with pre-charge complete state 527 shown in FIG. 5(b)differs from the neutral width pre-charge complete state 520 shown inFIG. 5(a) essentially because the purged cabinet state 525 has beeneliminated in FIG. 5(b). The neutral with pre-charge complete state 527closes the main contactor K1 and awaits for receipt of a start enginecommand from an operator or other device such as a remote host.

[0102] Further details of such remote host that may be utilized withthis invention are provided by related application Attorney Docket No.1215-379P the contents of which are hereby incorporated by reference.

[0103] The power off-line state 556 shown in FIG. 5(b) also differs fromthe power off-line state 555 shown in FIG. 5(a). Essentially, the poweroff-line state 556 combines the open contactor state 550 with the poweroff-line state 555 shown in FIG. 5(a). Thus, the power off-line state556 performs the functions of opening the contactor K1, switching themain inverter 70 to a voltage mode and setting the power level to anominal level to power the local loads. Furthermore, various systemchecks may be performed to maintain safe operation.

[0104] The operation of the state machine shown in FIG. 5(b) isessentially the same as that shown in FIG. 5(a) with differences notedbelow.

[0105] The main difference is the consolidation of the neutral withpre-charge complete state 520 and the neutral with purge complete state530 and the elimination of the purged cabinet state 525 from FIG. 5(a).Thus, when the pre-charge state 515 successfully completes thepre-charge cycle, the neutral with pre-charge state 527 is entered bythe state machine.

[0106] Upon receipt of an engine start command, the start engine state535 is entered by the state machine. Furthermore, upon a utility outage,the state machine transitions directly from the power on-line state 545to the power off-line state 556 as shown in FIG. 5(b).

[0107] By utilizing the state machines of either FIGS. 5(a) or 5(b), theinvention provides a real-time control method for controlling the linepower unit 100. This real-time control unit includes specificallydefined control states that ensure correct and safe operation-of theline power unit 100. Furthermore, various system checks and diagnosticsare performed throughout which further ensure safe operation and whichfurther affect state transitions.

[0108] Line Synchronization

[0109]FIG. 6(a) illustrates the frequency sensing component of thefrequency synthesizing apparatus and method according to the inventionin relation to other components of the line power unit 100 and theutility grid 99.

[0110] The phase and sequence detecting circuit 97 shown in FIG. 4 mayhave the construction shown in FIG. 6(a). More particularly, thesequence detector includes a transformer 605 connected to two phases A,B of the utility grid 99. In this way, transformer 605 inputs thevoltage and frequency of the utility grid 99.

[0111] This sensed voltage from transformer 605 is supplied to a lowpass filter 610 and then to an optical isolator 615. The output of theoptical isolator 615 is a uni-polar square wave as shown in FIG. 6(a)that is supplied to the line power unit controller 200. Specifically,the line power unit controller includes a vector control board 210having an A/D converter 215 that accepts the uni-polar square wave fromthe optical isolator 615.

[0112] The A/D converter preferably converts this uni-polar square waveinto a 10-byte digital signal that is fed to the digital signalprocessor (DSP) 220. The output of the DSP 220 is fed to a pulse widthmodulation (PWM) signal generation device 225.

[0113] The pulse width modulation signals from PWM 225 are fed to gatedrive circuit 230 which drives the IGBT switches 71 located within themain inverter 70. The main inverter 70 is fed a DC voltage from DC bus61 as shown in FIG. 4. For simplicity, this connection is not shown inFIG. 6(a).

[0114] The output of the main inverter 70 is filtered by inductor 72.Then, the voltage is stepped up by transformer 74 and supplied to theutility grid via contactor K1. The output of the transformer 74 alsosupplies local loads as shown in FIG. 6a.

[0115] The frequency synchronization apparatus shown in FIG. 6(a)operates in the following general manner. The output of the opticalisolator 615 is a uni-polar square wave with a voltage swing preferablywithin the limits of the A/D converter 215. The DSP 220 controls the A/Dconverter 215 by initiating the conversion and reading of the digitalvalue at a fixed frequency. This fixed frequency establishes the timebase for which the inventive methods can compute the actual frequency ofthe signal and thereby the actual frequency of the utility grid 99. Thisis accomplished by determining when the falling edge of the signaloccurred and counting the number of samples between successive fallingedges.

[0116] Alternatively, the invention could utilize the rising edge of thesignal, but for simplicity this explanation will focus on the fallingedge implementation.

[0117] FIGS. 6(b)-(d) illustrate various signals utilized by theinvention to perform synchronization. FIG. 6(b) illustrates the SYNCsignal that is the fixed frequency signal utilized by the DSP 220 tocontrol the initiation and reading of the data from the A/D converter215. FIG. 6(c) illustrates the THETA signal which is a variable insoftware that is utilized to represent the angle of the utility sinewave and ranges from 0° to 360° in a series of stepped ramps each ofwhich runs from 0° at the falling edge of the SYNC pulse to 360° at thenext falling edge of the SYNC pulse. FIG. 6(d) illustrates THETA˜whichis the phase shift added to THETA for power factor control as furtherdescribed below.

[0118] The synchronization method is further illustrated in FIG.7(a)-(b). As shown in FIG. 7(a), the synchronization function is startedor called every 64 microseconds at which time step 702 causes thedigital signal processor 220 to read the A/D 215 input. As furtherillustrated in FIG. 7(a), the input signal is a square wave at thefrequency of the grid.

[0119] Then, step 704 sets the minimum, maximum and typical constantswhich are set according to the selected grid frequency. The gridfrequency is chosen between either 50 or 60 hertz which thereby effectsthe values for the minimum, maximum and typical constants in step 704.

[0120] Thereafter, step 706 increments the frequency counter which isrepresented as FreqCount=FreqCount +1. The variable FreqCount is thenumber of times this routine is called between falling edges of theinput signal.

[0121] After step 706, then step 708 checks whether the FreqCountvariable is out of range. If so, the Count variable is set to a typicalvalue in step 710 and the step 712 then clears the status flag thatwould otherwise indicate that the line power unit 100 is insynchronization with the grid 99. In other words, step 712 clears thisstatus flag thereby indicating that the line power unit is not insynchronization with the grid 99.

[0122] After step 712 or if decision step 708 determines that theFreqCount is not out of range, then step 714 then determines whetherthere is an input from the falling edge detector. Step 714 determineswhether the falling edge of the synchronization pulse has occurred. Ifyes, then the flow proceeds to jump point A which is further illustratedin FIG. 7 (b)

[0123] Step 708 essentially determines whether the grid 99 is present orwhether there is a utility outage. If there is utility outage, then theFreqCount variable will exceed the maximum thereby causing the system toset the count value to a typical value in step 710.

[0124]FIG. 7(b) continues the frequency synchronization processbeginning with a determination of whether the frequency of the incomingsignal, input is within the correct range. Particularly, step 716determines whether the FreqCount variable is within the minimum andmaximum values. If not, then step 722 sets the count variable to atypical value and then step 724 sets a status flag indicatingsynchronization error.

[0125] On the other hand, if the FreqCount variable is within thecorrect range as determined by step 716, then step 718 sets the Countvariable equal to 360°/FreqCount. Then step 720 clears the status flagindicating no synchronization error.

[0126] After either steps 720 or 724, the method executes step 726 whichresets the FreqCount variable to 0.

[0127] Thereafter, the method then determines whether THETA is insynchronization with the incoming signal-input. THETA should equal 0 atthe same time the falling edge of the input signal is detected ifsynchronization has occurred. This is determined by step 728 whichchecks whether THETA is substantially equal to 360° or 0°. If not, thestatus flag is cleared by step 732 indicating that the line power unitis not in synchronization. If yes, then step 730 sets the status flagindicating that the LPU 100 is in synchronization with grid 99.

[0128] After setting the status flags in step 730 or step 732 then theprocess adjusts THETA to maintain or achieve synchronization with theinput signal. Particularly, step 734 first determines if THETA is lessthan 180°. If yes, then the error variable is set to minus THETA. Ifnot, then step 738 sets the error variable equal to 360°-THETA.

[0129] After setting the error variable in step 736 or step 738, thenthe method proceeds to limit the rate of change of the Error variable.The preferred embodiment shown in FIG. 7b limits the Error variable to+/−0.7° in step 740. Thereafter, step 742 sets the THETA variable equalto THETA plus the Error variable.

[0130] After step 742, the flow returns—via jump point B to the flowshown in FIG. 7(a) beginning with step 744.

[0131] As further shown in FIG. 7(a), the process proceeds after jumppoint B by generating THETA by incrementing THETA by the count variableevery 64 microseconds. This process generates the THETA signal shown inFIG. 6(c). More particularly, step 744 sets THETA=THETA+Count therebyincrementing THETA.

[0132] After step 744, decision step 746 determines whether THETA isgreater than 360°. If yes, step 748 resets THETA to THETA minus 360° tobring THETA within range.

[0133] If not, then step 750 determines the phase shift variableTHETA˜by setting THETA˜equal to THETA plus any desired phase shift.

[0134] THETA˜is an optional variable as is step 750. This optional step750 permits an operator to adjust the power factor of the three phasepower delivered to the grid 99 by utilizing the phase shift variable. Inessence, the operator merely needs to input data to set the phase shiftvariable to thereby adjust the power factor. Step 750 can then adjustthe power factor by setting THETA=THETA+phase shift.

[0135] After step 750, the synchronization function has completed itsoperations as indicated by end of SYNC function step 752. This routineis again called after 64 microseconds have elapsed since the initiationof the SYNC function in step 700.

[0136] The inventive methodology illustrated in FIGS. 7(a) and 7(b)outputs a THETA˜that is utilized by a known vector algorithm in thevector board 210 to generate pulse width modulation signals from PWM 225that are fed to gate drive 230 to thereby control the main inverter 70.Such pulse width modulation control of the power can then shift thephase of the power output from main inverter 70 and thereby bring theoutput power into synchronization with the utility grid 99.

[0137] Instead of sampling the grid-frequency, circuit 97 may alsosynthesize a grid frequency. This is necessary when the line power unit100 is operating in a stand-alone mode or when the utility grid 99 isnot available. Thus, the system must synthesize a frequency when thegrid is temporarily disconnected so that the output power frequency isself-regulating.

[0138] One of the advantages of the inventive line synchronizationtechnique is that it limits the resynchronization rate in step 740. Bylimiting the resynchronization rate, the invention provides a smoothtransition from out-of-SYNC line power unit 100 to an in-SYNC line powerunit 100 that is in synchronization with the utility grid 99. Thisreduces transient voltages, stress on the components and increasessafety.

[0139] As further described above, this line synchronization techniquealso permits power factor control such that an operator or remote hostcan input a phase shift data via port 321 and thereby control the powerfactor of power supplied to the grid 99.

[0140] Utility Outage Ride-through

[0141] The state machines described in FIGS. 5(a)-(b) include statesthat are involved in the utility outage ride-through methodology.Specifically, the neutral with start complete state 540, power on-linestate 545, open contactor state 550, and power off-line state 555 shownin FIG. 5(a) are the control states involved in the utility outageride-through methodology.

[0142] Alternatively, the neutral with start complete state 540, poweron-line state 545 and power off-line state 556 shown in FIG. 5b arealternative control states that may also be utilized by the utilityoutage ride-through methodology of this invention.

[0143] The utility outage ride-through methodology may be implementedwithin a controller such as the controller 200 shown in FIG. 3 or theLPU controller 200 shown in FIG. 4.

[0144] The utility outage ride-through method that may be programmedinto the LPU controller 200 is shown in FIG. 8. Furthermore, the utilityoutage ride-through methodology shown in FIG. 8 may be utilized by thestate machine shown in FIGS. 5a-b to control the state transitionsmentioned above.

[0145] The utility outage ride-through method shown in FIG. 8 beginswith step 800. Then, steps 805, 810, 815, 820, 825 determine theexistence of a fault condition. Upon the occurrence of any of thesefault conditions, then the flow proceeds to open main contactor step830.

[0146] More particularly, step 805 determines whether there is a loss ofutility authorization. In general, most electric utilities sendauthorization data to each electrical power generator supplying power tothe grid 99. In this way, the utility can either authorize or cancelauthorization for connection to the grid 99. Step 805 determines whetherthe utility authorization has been cancelled.

[0147] Step 810 determines whether there is a loss of phase. This may beperformed by sampling the input from the phase and sequence detector 97.If any of the phases have been lost, then step 810 directs the flow toopen main contactor step 830.

[0148] Similarly, loss of synchronization step 810 determines whetherthere is a loss of synchronization between the line power unit 100 andthe grid 99. This loss of synchronization may be determined from thestatus flag “LPU in SYNC” set by the synchronization method describedabove in relation to FIGS. 7(a)-(b).

[0149] Step 820 decides whether the industrial turbo generator (ITG)host has sent an off-line command via port 321 to the LPU controller. Itis not essential that an ITG host be utilized, and this step 820 may besimplified to receive any off-line command by LPU controller 200.

[0150] Step 825 determines whether the AC voltage of the grid 99 is outof range. The voltage sense circuit 98 senses this AC grid 99 voltageand sends a signal to the LPU controller 200 which can thereby determinewhether the VAC is out of range in step 825.

[0151] If any fault condition has occurred, then step 830 is executedwhich opens the main contactor K1 and disconnects the line power unit100 from the grid 99.

[0152] Thereafter, step 835 resets or clears a time counter which ispreferably a 30 second time counter.

[0153] Then, step 840 sets the operational mode to offline which causesthe state machine of FIG. 5(a) to transition from the open contactorstate 550 to the power off-line state 555. The power on-line state 545to open contactor state 550 transition occurs in step 830 and istriggered by any of the fault conditions described above.

[0154] Thereafter, off-line voltage control is initiated by step 845wherein the main inverter 70 is controlled by LPU controller 200 in avoltage control mode for stand-alone operation and feeding of the localloads.

[0155] After setting the off-line voltage control in step 845, step 850enables the main inverter 70 to thereby supply power to the local loads.This ends the flow as indicated by step 895.

[0156] The system then continues checking the occurrence of faultconditions as described above. Continued fault conditions have theeffect of clearing the 30 second counter each time.

[0157] When all of the faults have been cleared, then the flow proceedsto step 855 which determines whether the on-line or off-line mode(state) is being utilized by the line power unit 100. Continuing withthis example, the off-line mode is now utilized by the state machine.Thus, the mode determination step 855 directs the flow to step 860 whichbegins incrementing the 30 second counter.

[0158] If the counter has not yet reached the 30 second time limit, thenstep 865 directs the flow to off-line voltage control setting step 845and enable three phase inverter step 850 the effect of which is toreturn or loop back to the increment 30 second counter step 860.

[0159] This loop continues until the 30 second counter has elapsed asdetermined by step 865. Thereafter, step 870 disables the main inverter70. After disabling the main inverter 70, step 875 closes main contactorK1 thereby connecting the line power unit 100 to the grid 99. Then, themode is set to the online mode which transitions the state machine fromthe neutral with start complete state 540 to the power on-line state545. This also causes the next loop to take. the left branch asdetermined by the mode determination step 855 which will now sense theonline mode.

[0160] If the mode is on-line, the flow proceeds from step 855 toon-line current control step 885 which controls the main inverter 70 ina current control mode. Thereafter, step 890 enables the inverter 70 tothereby supply power to the grid 99 via closed contactor K1. The processis then completed as indicated by end step 895.

[0161] By utilizing the utility outage ride-through methodology above,the invention has the capability of detecting a utility outage or otherfault condition thereby triggering disconnection from the grid. Theinvention also provides a smooth transition from a current mode (utilityconnected) to a voltage mode (utility outage) for the main inverter 70.

[0162] The benefit is more stability and faster response to wide swingsin generator voltage. The invention also has the feature of over-currentlimiting which is a self-protection function which prevents voltagebrown-out at excessive current levels. This method also easilytransitions from voltage mode to current mode when reconnecting to thegrid thereby minimizing transients on power output to the grid 99.

[0163] When the line power unit 100 disconnects from the grid 99, atypical system will vary greatly in speed and output voltage as it israpidly unloaded. To prevent such large voltage swings from reaching theinverter 70 output, a feed forward technique is utilized as describedabove to control the inverter 70 output voltage.

[0164] Using such feed forward control, the generator voltage is sampledand used to establish the modulation index of the pulse-width modulatedsinusoidal voltage produced by the inverter 70 keeping the sinusoidaloutput voltage nearly constant. This control technique provides the highlevel of stability and fast response needed for rapid changes of inputvoltage. Over-current protection is provided by reducing the modulationindex when the maximum allowed output current is reached, producing abrown-out effect.

[0165] When the grid power is restored, the line power unit 100 voltageis first synchronized with the grid voltage. After synchronizing withthe grid (as determined by step 815 and implemented by thesynchronization techniques described above), normal current controlledpower flow into the grid 99 can then resume.

[0166] Power Factor Control

[0167] The system may be further enhanced by providing an apparatus andmethod for controlling the power factor of power delivered to the grid99. Although the synchronization control described above also providespower factor control, the invention also provides an alternative controlloop that controls the power factor.

[0168] The power factor control device and methods according to theinvention may be applied to a wide variety of grid-connected generationfacilities as graphically illustrated by FIG. 2. The current controlledinverter 70 may be controlled with the device shown in FIG. 9.

[0169]FIG. 9 illustrates a device for controlling power factor thatinterfaces with a current controlled inverter 70 as shown in FIG. 9 or,alternatively, the current controlled inverter 70 shown in FIGS. 2 or 4.

[0170] This power factor control device includes a sensor 98 that sensesthe current supplied to the utility 99 from the inverter 70. All threephases (I_(a), I_(b), I_(c)) of the current supplied to the utility 99are sensed by sensor 98 and supplied to three-phase to two-phasetransformer 905 to output two-phase D-Q coordinate signals I_(d), I_(q).

[0171] The two-phase signals I_(d), I_(q) are then supplied to astationary-to-rotating reference frame transformation unit 910 thatchanges the two-phase AC signals (I_(d), I_(q)) from the stationary to asynchronously rotating reference frame which converts the signals fromAC to DC.

[0172] The DC signals are then compared against reference signalsi_(q Ref), I_(d Ref) by comparators 920 and 925, respectively. Thecomparators 920, 925 are preferably proportional-plus-integral gainstages that perform proportional-plus-integral comparison operationsbetween the reference signals I_(q Refi) I_(d Ref) and the DC signalsI_(d), I_(q), The reference signals I_(q Ref), I_(d Ref) may be suppliedby the LPU controller 200 which, in turn, may be supplied thesereference signals from an operator via port 321, LPU external interface320, I/O controller 310. In this way, either the LPU controller 200 orthe operator can command the power factor.

[0173] Furthermore, the utility may also request a certain power factorto be supplied to the grid 99 by the line power unit 100. Such a requestcan be fed to the system via the reference signals I_(q Ref), I_(d Ref).

[0174] The proportional plus integral gain stages 920,925 output voltagesignals V_(q), V_(d) that are transformed back to a stationary referenceframe by rotating to stationary reference frame transforming unit 930 tooutput AC voltages V_(q), V_(d). These AC voltages are then subjected toa two-phase to three-phase transform by unit 935 to thereby outputthree-phase voltages V_(a), V_(b), V_(C) which are then sent to a pulsewidth modulator which controls the switches in a three-phase, full-waveIGBT bridge within the inverter 70 to produce AC currents (I_(a), I_(b),I_(c)) with a vector that contains the real and reactive componentscommanded by I_(d Ref) and I_(q Ref).

[0175] This power factor control loop provides independent control ofthe real and reactive components of the current output to utility 99.This invention draws upon widely known vector control techniquesdeveloped for induction motor drives. The desired amplitudes of real andreactive current supplied to the utility 99 are commanded by I_(q ref)and I_(d ref), respectively. The control loop described above drives theoutput current to the utility (I_(a), I_(b), I_(c)) so that themagnitude and phase contain the commanded real and reactive currentcomponents.

[0176] This is often beneficial in improving the power factor in theutility distribution system 99. Furthermore, the utility interface 99may also be a local grid. Such a local grid may also require powerfactor correction due to large inductive or capacitive loads on thelocal grid. The poor power factor that such large inductive orcapacitive loads cause may be corrected by utilizing the power factorcontrol method and apparatus disclosed herein.

[0177] The invention being thus described, it will be obvious that thesame may be varied in many ways. Such variations are not to be regardedas departure from the spirit and scope of the invention, and all suchmodifications as would be obvious to one skilled in the art are intendedto be included within the scope of the following claims.

1. A state machine having a plurality of control states for electricpower transformation in a device having a full wave rectifier connectedto a generator, a DC bus connected to the output of the full waverectifier, an inverter connected to the DC bus, an inductor unitconnected to the output of the inverter, a first contactor unitselectively connecting and disconnecting the inductor unit to and from agrid, and a precharge circuit connected to the DC bus; the state machinecomprising: an initialization state for initializing the state machine;a first neutral state for idling the state machine while monitoringcommands and system parameters; a pre-charge state for enabling andmonitoring the precharge circuit to pre-charge the DC bus to apre-charge DC voltage; a second neutral state for disabling thepre-charge circuit and closing the first contactor; an engine startstate for verifying DC link voltage, sending a speed command to thestart inverter unit, enabling the start inverter, updating the speedcommand being sent to the start inverter unit, and determiningsuccessful engine start; a power on-line state for enabling a currentmode in said inverter and controlling the inverter to deliver power at alevel determined by a power level command; a power off-line state foropening the first contactor, switching the inverter to a voltage mode,and setting the power level command to a nominal power level; a shutdownstate for disabling the inverter, opening the first contactor afterwaiting for a cool-down time period, and reinitializing the statemachine, a state controller for controlling the following permittedtransitions between said control states: said initialization state →said first neutral state ←→ said pre-charge state → said second neutralstate ←→ said start engine state ←→ said power on-line state → saidpower off-line state → said shutdown state.
 2. The state machineaccording to claim 1, further comprising: a third neutral state forreceiving a command including the power level command and a shutdowncommand; said state controller permitting the following additional statetransitions: said start engine state → said third neutral state ←→ saidpower on-line state.
 3. The state machine according to claim 1, saidstate controller permitting the following additional state transitions:neutral state → pre-charge state upon receiving a pre-charge startcommand; precharge state → neutral state when a pre-charge rate at whichsaid pre-charge circuit charges the DC bus is not within tolerancevalues or when the DC bus voltage does not achieve the pre-charge DCvoltage.
 4. The state machine according to claim 1, said statecontroller permitting the following additional state transitions:pre-charge state → start engine state upon successfully achieving theprecharge DC voltage on the DC bus and receipt of a start enginecommand.
 5. The state machine according to claim 1, said statecontroller permitting the following additional state transitions: startengine state → third neutral state upon receiving a zero power levelcommand, third neutral state → power on-line state uponsuccessful-engine start and receiving a nonzero power level command,power on-line state → power off-line state upon receipt of an off-linecommand or upon a failed diagnostic test or a grid outage, poweroff-line →third neutral state upon successful diagnostic tests for apredetermined time period, third neutral state → shutdown upon receivinga shutdown command, shutdown state → said first neutral state uponreceiving restart command, and said second neutral → shutdown state upona fault condition or shutdown command.
 6. The state machine according toclaim 1, the device further including an emergency stop input, saidstate machine controller opening the first contactor unit and switchingthe control state to said shutdown state upon receipt of an emergencystop signal from the emergency stop input.
 7. The state machineaccording to claim 1, said pre-charge state and said start engine staterespectively returning to said first and second neutral states uponfailure of a pre-charge cycle and a start engine cycle.
 8. The statemachine according to claim 2, said power on-line state returning to saidthird neutral step when the power level command indicates zero requestedpower.
 9. The state machine according to claim 1, wherein saidinitialization, pre-charge, power on-line, power off-line, and/orshutdown states perform diagnostic tests on the device, said statecontroller controlling state transitions based on results of thediagnostic tests.
 10. The state machine according to claim 1, the devicefurther including an engine for driving said generator, an enginecontrol unit connected to said engine, and a start inverter connected tothe DC bus and to said generator, said engine control unit controllingsaid engine ignition and fuel for the engine, said engine start statecontrolling said start inverter to drive the generator as a motor tothereby spin the engine and permit starting thereof, said engine startstate also sending an engine start command to the engine control unit.11. The state machine according to claim 10, wherein saidinitialization, pre-charge, power on-line, power off-line, and/orshutdown states monitor the engine, said state controller controllingstate transitions based on results of the diagnostic tests.
 12. Thestate machine according to claim 1, said pre-charge state alsodiagnosing the inverter, said state controller controlling statetransitions based on results of the diagnostic tests.
 13. The statemachine-according to claim 1, said engine start state determiningsuccessful engine start by monitoring current drawn from the DC bus bythe start inverter and engine speed wherein if the current drawn fallsbelow a current limit value and an engine speed exceeds a speed limitthen engine start is successful.
 14. A method of controlling real andreactive power developed by a main inverter in an electrical powergeneration control device, comprising the steps of: sampling thethree-phase currents output from said inverter, transforming the sampledthree-phase current data to two-phase current data, transforming thetwo-phase current data to a rotating reference frame, controlling anoutput voltage according to a comparison result between a DC referencesignal having a real and a reactive reference signal component,transforming the output voltage to a stationary reference frame,transforming the stationary reference frame output voltage to athree-phase reference signal, and controlling said inverter based on thethree-phase reference signal, wherein the DC reference signal designatesthe real and reactive power output by the controlled inverter.
 15. Themethod according to claim 14, further comprising the step of: connectingthe electrical power generation control device to a grid, determiningthe value of the DC reference signal according to utility power factorrequest data supplied by a utility feeding the grid.
 16. The methodaccording to claim 14, further comprising the step of: determining thevalue of the DC reference signal according to a power factor commandreceived from an operator interface.
 17. The method according to claim14, said output voltage controlling step utilizing a proportional andintegral control method.
 18. The method according to claim 14, saidinverter control step generating a PWM control signal based on thethree-phase reference signal to control the inverter output.
 19. Anapparatus for synchronizing a line frequency of power output from aninverter with a grid frequency, comprising: a grid frequency sensorconnected to the grid and outputting a grid frequency signal indicativeof the grid frequency; an A/D converter sampling the grid frequencysignal from said grid frequency signal generator; a signal processorcontrolling said A/D converter to perform A/D conversion of the gridfrequency signal at a reference frequency; a clock connected to saiddigital signal processor for establishing the reference frequency andsending the reference frequency to said digital signal processor; afirst counter for storing a frequency count, said first counter updatingthe frequency count value according to the reference frequency; an edgedetector for detecting a rising or falling edge of the digitallyconverted grid frequency; a second counter for storing a synchronizationvalue, said second counter adding a count value to the synchronizationvalue according to the reference frequency; a correct frequency rangedetector detecting whether the frequency count is within a frequencyrange; a frequency range error corrector for setting the count value toa predetermined count value when said correct frequency range detectordetects that the frequency count is outside the frequency range; a countvalue calculator for calculating the count value by dividing 360° by thefrequency count when said edge detector detects the rising or fallingedge; a frequency count resetter for resetting the frequency count valueto zero when said edge detector detects the rising or falling edge andsaid count value calculator completes the calculation of the countvalue; a synchronization detector detecting synchronization when thesynchronization value is substantially zero or 360°; and asynchronization value adjuster for adjusting the synchronization valueby an error value.
 20. The apparatus according to claim 19, furthercomprising: an iterator for iterating the functions performed by theapparatus until said synchronization detector detects correctsynchronization.
 21. The apparatus according to claim 19, saidsynchronization value adjuster calculating the error value based on thesynchronization value, an error limiter limiting the error value to apredetermined range of error values thereby preventing large phase shiftjumps.
 22. The apparatus according to claim 20, further comprising: apulse width modulation signal generator for generating pulse widthmodulation signals based on the synchronization value and sending thepulse width modulation signals to the inverter, wherein the output ofthe inverter is controlled by the pulse width modulation signals. 23.The apparatus according to claim 22, further comprising; a power factoradjuster for adding a power factor phase shift value to thesynchronization value.
 24. The apparatus according to claim 23, saidgrid frequency sensor including: a transformer connected to the grid, alow pass filter connected to said transformer, and an optical isolatorconnected to said low pass filter, said optical isolator outputting auni-polar square wave having a frequency equal to the grid frequency,said A/D converter sampling the uni-polar square wave from said opticalisolator, and said digital signal processor controlling said A/Dconverter to initiate A/D conversion of the uni-polar square wave at areference frequency.
 25. A method for synchronizing a line frequency ofpower output from an inverter with a grid frequency, comprising:detecting a grid frequency signal; sampling the grid frequency signal;controlling said sampling step to sample the grid frequency signal at areference frequency; establishing the reference frequency; storing afrequency count value in a first counter, updating the frequency countvalue stored in the first counter according to the reference frequency;an edge detecting step for detecting a rising or falling edge of thesampled grid frequency; storing a synchronization value in a secondcounter, adding a count value to the synchronization value according tothe reference frequency; detecting whether the frequency count is withina frequency range; a frequency range error correcting step for settingthe count value to a predetermined count value when said detecting stepdetects that the frequency count is outside the frequency range;calculating the count value by dividing 360° by the frequency count whensaid edge detecting step detects the rising or falling edge; resettingthe frequency count value to zero when said edge detecting step detectsthe rising or falling edge and said calculating step completes thecalculation of the count value; detecting synchronization when thesynchronization value is substantially zero or 360°; and adjusting thesynchronization value by an error value.
 26. The method according toclaim 25, further comprising the step of: iterating the functionsperformed by the method steps until said synchronization detecting stepdetects correct synchronization.
 27. The method according to claim 25,said adjusting step calculating the error value based on thesynchronization value, an error limiting step limiting the error valueto a predetermined range of error values thereby preventing large phaseshift jumps.
 28. The method according to claim 26, further comprisingthe step of: generating pulse width modulation signals based on thesynchronization value, controlling the output of the inverter with thepulse width modulation signals.
 29. The method according to claim 26,further comprising the step of: inputting a power factor phase shiftvalue, and adding the power factor phase shift value to thesynchronization value.
 30. A method of controlling a device having afull wave rectifier connected to a generator, a DC bus connected to theoutput of the full wave rectifier, an inverter connected to the DC bus,an inductor unit connected to the output of the inverter, and a firstcontactor unit selectively connecting and disconnecting the inductorunit to and from a grid, the method comprising the steps of: commandingthe inverter to perform online voltage control; detecting a faultcondition indicating a fault in the device or the grid opening the firstcontactor; clearing a time counter; setting a mode to an offline mode;and commanding the inverter to perform offline voltage control; saidopening, clearing, setting and commanding offline voltage control stepsbeing performed when said detecting step detects the fault condition orcontinues to detect the fault condition.
 31. The method according toclaim 30, further comprising the steps of: determining the mode whensaid detecting step detects no fault condition; and incrementing thetime counter when said mode determining step determines that the mode isthe offline mode.
 32. The method according to claim 31, furthercomprising the steps of: checking the time counter for expirationthereof; disabling the inverter; closing the contactor; and setting themode to the online mode, wherein said disabling, closing and setting theonline mode steps are performed when said checking step determines thatthe time counter has expired.
 33. The method according to claim 32,further comprising the steps of: determining the mode when saiddetecting step continues to detect no fault condition; commanding theinverter to perform online current control; and enabling the inverter,said commanding online current control step and said enabling step beingperformed when said mode determination step determines that the mode isthe online mode.
 34. The method according to claim 33, furthercomprising the step of: iterating the method.
 35. The method accordingto claim 30, wherein the fault condition includes a fault in the device,loss of phase in the grid, loss of utility authorization, grid voltageout of range, or loss of synchronization between the device and thegrid.
 36. The method according to claim 30, inputting an offlinecommand, wherein upon receipt of the offline command said detecting stepdetects the fault condition.
 37. The method according to claim 30,wherein the predetermined time period is approximately 30 seconds.